.class public Lcom/glympse/platform/common/SendSmsJob;
.super Lcom/glympse/platform/common/JobQueue$Job;
.source "SendSmsJob.java"


# static fields
.field private static final ms_oSync:Ljava/lang/Object;


# instance fields
.field private m_fSuccess:Z

.field private m_oRecipient:Lcom/glympse/platform/common/Recipient;

.field private m_strMessage:Ljava/lang/String;

.field private m_strNumber:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 18
    new-instance v0, Ljava/lang/Object;

    invoke-direct {v0}, Ljava/lang/Object;-><init>()V

    sput-object v0, Lcom/glympse/platform/common/SendSmsJob;->ms_oSync:Ljava/lang/Object;

    .line 16
    return-void
.end method

.method public constructor <init>(Lcom/glympse/platform/common/Recipient;Ljava/lang/String;)V
    .locals 1
    .parameter "oRecipient"
    .parameter "strMessage"

    .prologue
    .line 26
    invoke-direct {p0}, Lcom/glympse/platform/common/JobQueue$Job;-><init>()V

    .line 23
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/glympse/platform/common/SendSmsJob;->m_fSuccess:Z

    .line 28
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/glympse/platform/common/SendSmsJob;->m_fCompleteOnMainThread:Z

    .line 30
    iput-object p1, p0, Lcom/glympse/platform/common/SendSmsJob;->m_oRecipient:Lcom/glympse/platform/common/Recipient;

    .line 31
    iput-object p2, p0, Lcom/glympse/platform/common/SendSmsJob;->m_strMessage:Ljava/lang/String;

    .line 32
    iget-object v0, p1, Lcom/glympse/platform/common/Recipient;->m_strTo:Ljava/lang/String;

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->GetDigitsString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/glympse/platform/common/SendSmsJob;->m_strNumber:Ljava/lang/String;

    .line 33
    return-void
.end method


# virtual methods
.method public OnComplete(Lcom/glympse/platform/common/JobQueue;)V
    .locals 2
    .parameter "oJobQueue"

    .prologue
    .line 52
    iget-boolean v0, p0, Lcom/glympse/platform/common/SendSmsJob;->m_fSuccess:Z

    if-nez v0, :cond_0

    .line 54
    iget-object v0, p0, Lcom/glympse/platform/common/SendSmsJob;->m_oRecipient:Lcom/glympse/platform/common/Recipient;

    const/4 v1, 0x4

    iput v1, v0, Lcom/glympse/platform/common/Recipient;->m_eSendState:I

    .line 55
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v0

    const/16 v1, 0x1000

    invoke-virtual {v0, v1}, Lcom/glympse/platform/Platform;->DoUpdate(I)V

    .line 57
    :cond_0
    return-void
.end method

.method public OnProcess()V
    .locals 5

    .prologue
    .line 42
    sget-object v0, Lcom/glympse/platform/common/SendSmsJob;->ms_oSync:Ljava/lang/Object;

    monitor-enter v0

    .line 44
    :try_start_0
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "Sending SMS to: "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v2, p0, Lcom/glympse/platform/common/SendSmsJob;->m_strNumber:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 45
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v1

    iget-object v2, p0, Lcom/glympse/platform/common/SendSmsJob;->m_oRecipient:Lcom/glympse/platform/common/Recipient;

    iget-object v3, p0, Lcom/glympse/platform/common/SendSmsJob;->m_strNumber:Ljava/lang/String;

    iget-object v4, p0, Lcom/glympse/platform/common/SendSmsJob;->m_strMessage:Ljava/lang/String;

    invoke-virtual {v1, v2, v3, v4}, Lcom/glympse/platform/Platform;->SendSms(Lcom/glympse/platform/common/Recipient;Ljava/lang/String;Ljava/lang/String;)Z

    move-result v1

    iput-boolean v1, p0, Lcom/glympse/platform/common/SendSmsJob;->m_fSuccess:Z

    .line 42
    monitor-exit v0

    .line 47
    return-void

    .line 42
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method
